from enum import Enum


class ByteOrder(Enum):
    BIG = "大端（高位在前）"
    SMALL = "小端（低位在前）"

    @staticmethod
    def values():
        return tuple(f.value for f in ByteOrder)

    @staticmethod
    def names():
        return tuple(f.name.lower() for f in ByteOrder)

    @staticmethod
    def get_name(value):
        for k, v in ByteOrder.__members__.items():
            if v.value == value:
                return k.lower()
        return None
